package com.xingkeduo.pojo.table;

import org.apache.ibatis.type.Alias;

import com.xingkeduo.util.pojo.base.BaseEnum;
import com.xingkeduo.util.pojo.base.BaseTable;

/**
 * 一线员工跟踪信息类
 * 
 * @author 高杰
 * @time 2019年3月12日 下午4:13:22
 * @description
 */
@Alias("CraftsmanTrace")
public class CraftsmanTraceTO extends BaseTable<CraftsmanTraceTO> {
	public enum Type implements BaseEnum {
		INIT(10, "创建"),
		TEST1(20, "初试审核"),
		TEST2(30, "复试审核"),
		TEST3(40, "毕业考核"),
		BIND(50, "绑定店铺"), 
		FIRSTSERVICE(60, "服务第一单"),
		BACK(70, "返校进修"),
		FREEZON(80, "开始停薪留职"),
		LEAVING(90, "确认离职");

		private int value;
		private String desc;

		private Type(int value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		public static boolean validValue(String value) {
			int value_int = Integer.parseInt(value);
			return validValue(value_int);
		}

		public static boolean validValue(int value) {
			Type[] types = Type.values();
			for (int i = 0; i < types.length; i++) {
				if (types[i].getValue() == value)
					return true;
			}
			return false;
		}

		public static Type getType(String value) {
			int value_int = Integer.parseInt(value);
			return getType(value_int);
		}

		public static Type getType(int value) {
			switch (value) {
			case 10:
				return INIT;
			case 20:
				return TEST1;
			case 30:
				return TEST2;
			case 40:
				return TEST3;
			case 50:
				return BIND;
			case 60:
				return FIRSTSERVICE;
			case 70:
				return BACK;
			case 80:
				return FREEZON;
			case 90:
				return LEAVING;
			default:
				return null;
			}
		}

		@Override
		public int getValue() {
			return value;
		}

		public String getDesc() {
			return desc;
		}
	}

	private String login;
	private Type type;

	public Type getType() {
		return type;
	}

	public CraftsmanTraceTO setType(Type type) {
		this.type = type;
		return this;
	}

	public String getLogin() {
		return login;
	}

	public CraftsmanTraceTO setLogin(String login) {
		this.login = login;
		return this;
	}
}
